package com.codeest.geeknews.ui.main;

import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;

import com.codeest.geeknews.R;

/**
 * Created by admin on 2017/8/4.
 */

public class LoadingDialogFragment extends DialogFragment {
    @SuppressWarnings("unchecked")
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //1 通过样式定义
        setStyle(STYLE_NORMAL, R.style.Mdialog);
        //2代码设置 无标题 无边框
        //setStyle(DialogFragment.STYLE_NO_TITLE|DialogFragment.STYLE_NO_FRAME,0);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
        View view = inflater.inflate(R.layout.fragment_dialog_loading, container);
        return view;
    }

    public void show(android.support.v4.app.FragmentManager manager) {
        show(manager, getClass().getSimpleName());
    }


}
